import { createRouter, createWebHistory } from 'vue-router'
import Mold from '../views/mold/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'mold',
      component: Mold,
    },
    {
      path: '/model',
      name: 'model',
      // component: () => import('../views/model/index.vue'),
      children: [
        {
          path: '',
          name: 'modelList',
          component: () => import('../views/model/index.vue'),
        },
        {
          path: ':mid',
          name: 'modelDetail',
          component: () => import('../views/model-detail/index.vue'),
        },
        {
          path: 'create',
          name: 'createModel',
          component: () => import('../views/model/create-model.vue'),
        },
      ],
    },
  ],
})

export default router
